package com.bgs.eat.commodityOrder.entity;

import com.bgs.eat.commodity.entity.CommodityEntity;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;

import javax.naming.Name;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Transient;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;

/**
 * @ClassName CommodityOrderEntity
 * @Description TODO 商品订单实体类
 * @Author lzy
 * @Date 2022/10/19 18:47
 **/
@Data
@Table(name = "commodity_order")
public class CommodityOrderEntity {

    @Id
    private Integer id;

    private String orderNumber; // 订单编号

    private Integer userAddressId; // 用户详细地址ID

    private Integer userProtalId; // 用户id

    private String shopAddress; // 店铺详细地址

    private Integer provinceId; // 省id

    private Integer cityId; // 市id

    private Integer countyId; // 县id

    private Integer riderId; // 骑手id

    private String takeOutNumber; // 取餐单号

    private Integer distributionMode; // 取餐方式

    private Integer distributionStatus; // 配送状态

    private Integer orderStatus; // 订单状态

    private String shopName;//店铺名称

    private Double weight; // 重量（kg）

    private String remark; // 备注

    private BigDecimal sumOrderPrice; // 订单价格

    private BigDecimal sumPackPrice; // 包装费

    private BigDecimal distributionPrice; // 配送价格

    private String userLat; //顾客纬度

    private String userLng; //顾客经度

    private String shopLat; //店铺纬度

    private String shopLng; //店铺经度

    private String ramainingItem; //剩余时间

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date createTime; // 创建时间

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date updateTime; // 修改时间

    private String deliveryTime; // 送达时间

    private String payMode; // 支付方式

    private Integer shopId; // 店铺ID

    private String sumTableware; // 餐具数量

    private BigDecimal firmPrice; // 公司抽成金额

    @Transient
    private List<CommodityEntity> sumList;

    @Transient
    private String estimatedTime; //预计送达时间

    @Transient
    private String userShopDistance; //用户和商家的距离

    @Transient
    private String riderShopDistance; //骑手距离商家距离

    @Transient
    private String totalDistance; //总距离

    @Transient
    private String detailedTime; //详细时间

    @Transient
    private String userAddress; // 用户地址

    @Transient
    private String userName;//用户名称

    @Transient
    private String flag;//订单是否到账

    @Transient
    private String orderFlag;//已超时/未超时

}
